'use strict';

angular.module('com.dcos.app').factory('UserCenterService', function($http) {
	return {
		getlist: function (usertype,dept_id) {
	      return $http({
	        method: 'POST',
	        url:'/v1/user/querylist',
	        data:JSON.stringify({usertype:usertype,dept_id:dept_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		detail: function (userid) {
	      return $http({
	        method: 'POST',
	        url:'/v1/user/query',
	        data:JSON.stringify({userid:userid}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		save: function (data) {
	      return $http({
	        method: 'POST',
	        url:'/v1/user/save',
	        data:JSON.stringify(data),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		update: function (data) {
	      return $http({
	        method: 'POST',
	        url:'/v1/user/update',
	        data:JSON.stringify(data),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		delete: function (userid) {
	      return $http({
	        method: 'POST',
	        url:'/v1/user/save',
	        data:JSON.stringify({userid:userid}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
	}
});
